<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>CKEDITOR.dom.window</title>
	<link rel="stylesheet" type="text/css" href="../../test.css" />
	<script type="text/javascript" src="../../../ckeditor.js"></script>
	<script type="text/javascript" src="../../test.js"></script>
	<script type="text/javascript">
	//<![CDATA[

var loadCalled;

var testWindow = new CKEDITOR.dom.window( window );

var t;

testWindow.on( 'load', function()
	{
		t = document.createElement( 'textarea' );
		t.id = 'fred';

		document.body.appendChild( t );

		loadCalled = true;
	});

testWindow.on( 'beforeunload', function()
	{
		t.value = new Date();
	});

CKEDITOR.test.addTestCase( (function()
{
	// Local reference to the "assert" object.
	var assert = CKEDITOR.test.assert;

	return {
		test_loadEvent : function()
		{
			assert.isTrue( loadCalled );
		},

		name : document.title
	};
})() );

	//]]>
	</script>
</head>
<body>
	<div id="test1"></div>
</body>
</html>
